package cn.hxzy.service;

import cn.hxzy.domain.Chapter;
import cn.hxzy.domain.Course;
import cn.hxzy.domain.Section;
import cn.hxzy.response.R;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * @Author LiDong
 * @Description
 * @create 2024/6/22 16:48
 */
public interface CourseService extends IService<Course> {
    R createCourse(Course course);

    R updateCourse(Course courseDetails);

    Boolean deleteCourse(Long id);


    R createChapter(Chapter chapter);

    R createSection( Section section);

    void uploadMaterial(Long sectionId, MultipartFile file);

    List<Course> searchCourse(String searchName);

    List<Course> listCourse();

    R<List<Chapter>> listChapter(Long courseId);

    List<Section> listSection(Long chapterId);

     Integer grantClass(Long courseId, List<String> classIds);

    Integer grantStudent(Long courseId, List<String> studentIds);

    /**
     * 添加班级
     * @param courseId 课程id
     * @param classIdList 班级id
     * @return 影响行数
     */
    int addGrantClass(Long courseId, List<Integer> classIdList);

    List<Integer> getCourseIdByClassId(Long classId);

}
